<template>
  <div>
    <title-h3 :title="'商家公告'" />

    <div class="show-gonggao">
      <ul>
        <li v-for="item in listData" :key="item.id">
          <span>{{ item.updateDate }}</span>
          <p>{{ item.adInfo }}</p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import TitleH3 from './TitleH3.vue'

export default {
  components: { TitleH3 },
  data() {
    return {
      listData: []
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    async getData() {
      const { data } = await this._axios.get(`/ad/findlistbyadtype/${1}`)
      this.listData = data
    }
  }
}
</script>

<style lang="scss" scoped>
.show-gonggao {
  ul {
    background-color: #f8f8f8;
    padding: 10px 20px 10px 10px;
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.15);
  }

  li {
    display: flex;
    line-height: 30px;
    font-size: 12px;

    span {
      margin-right: 10px;
    }
  }
}
</style>
